<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>角色管理</title>
	<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="../css/main-page.css" />
	<script type="text/javascript" src="../easyui/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="../js/win.js"></script>
	<script type="text/javascript">
		function addRole(){
			openUrl("新增角色", 400, 300, "../role/initEditPage.do");
		}
		
		function reloadDg(){
			$("#dg").datagrid("reload");
			closeWin();
		}
		
		function deleteRole(){
			checkSelectSomeDoAction("#dg", "删除", "角色", "../role/deleteRole.do", true);
		}
		
		function editRole(){
			selectOneOpenUrl("#dg","../role/initEditPage.do", 400, 300, "修改", "角色");
		}
		
		function editRoleRes(id){
			openUrl("角色资源", 700, 500, "roleResManager.jsp?id="+id);
		}
		
		function editRoleUser(id){
			openUrl("角色人员", 700, 500, "roleUserManager.jsp?id="+id);
		}
	</script>
</head>
<body>
	<div class="dg-content">
		<table id="dg" class="easyui-datagrid" title="角色列表"
			data-options="rownumbers:true,
				fitColumns:true,iconCls:'icon-table',url:'../role/listRoles.do'">
			<thead>
				<tr>
					<th data-options="field:'ck',checkbox:true"></th>
					<th data-options="field:'id',hidden:true"></th>
					<th data-options="field:'name',width:120,align:'center'">名称</th>
					<th data-options="field:'scope',width:60,align:'center'">类型</th>
					<th data-options="field:'opt',width:40,align:'center'">操作</th>
				</tr>
			</thead>
		</table>
	</div>
	<div class="dg-foot">
		<div class='dg-toolbar'>
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" 
				plain="true" onclick="addRole()">新增</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-edit" 
				plain="true" onclick="editRole()">修改</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" 
				plain="true" onclick="deleteRole()">删除</a>
		</div>
	</div>
</body>
</html>